﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace QuanLyThuNgan
{
    public class ThuDTL_DeleteDAO
    {
        //danh muc ly do xoa-----------------
        public DataTable m_SelectDMLyDoXoa()
        {
            string _sql = string.Format("usp_ThuNgan_ThuDTLDelete_SelectLyDoXoa ");
            return Uit.it_SQL.getDataTable(_sql, null, "");
        }
        //load thong tin chi tiet-----------------
        public DataTable m_SelectThuDTLDelete(ThuDTL_DeleteDTO _info)
        {
            string _sql = string.Format("usp_ThuNgan_ThuDtlDelete_SelectAll '{0}','{1}' ",_info.SSobnTim,_info.SNgayTim );
            return Uit.it_SQL.getDataTable(_sql, null, "");
        }

        //delete gia tri chi tiet-----------------
        public bool m_DeleteThuDTL(ThuDTL_DeleteDTO _info)
        {
            string _sql = string.Format("usp_ThuNgan_ThuDTLDelete_Delete '{0}'", _info.Ssobn);
            return Uit.it_SQL.ExecuteNonQuery(_sql, false);
        }

        //INSER gia tri chi tiet-----------------
        public bool m_InsertThuDTL(ThuDTL_DeleteDTO _info)
        {
            string _sql = string.Format("usp_ThuNgan_ThuDtlDelete_Insert '{0}','{1}','{2}',{3},'{4}',{5},{6},'{7}',{8},{9},{10},{11},'{12}',{13},{14},N'{15}'", _info.Ssobn,_info.Ssohs,_info.Ssonhapvien,_info.Istt,_info.Sngaynop, _info.Fsotien, _info.Ifeeid,_info.Snoivao,_info.ISttThuNgan, _info.IIDNguoiNhap, _info.IIDXacNhan, _info.IIDcaThuNgan,_info.SNgayXoa, _info.IIDLyDoXoaCT, _info.IIDNguoiXoa, _info.SGhiChuXoa);
            return Uit.it_SQL.ExecuteNonQuery(_sql, false);
        }
    }
}
